import requests

from common.get_02_token import get_02_token
from config import token

from common import get_token


class IRHMAddApi:
    @classmethod
    def add(cls,json):
        token=get_02_token()
        # 发送 添加员工
        add_url ='http://ihrm2-test.itheima.net/api/sys/user'
        headers = {
            "Content-Type":"application/json",
            "Authorization":token
        }
        r = requests.post(add_url, headers=headers, json=json)
        return r


if __name__ == '__main__':
    json = {
        "username": "大头",
        "mobile": "17740651421",
        "workNumber": "9527"
    }
    r = IRHMAddApi.add(json)
    print(r.json())
